#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 2e5 + 10;
const int MOD = 1e9 + 7;
int t, n, q;
int a[MAXN];

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);

    cin >> t;
    while (t--) {
        cin >> n >> q;
        for (int i = 1; i <= n; i++) cin >> a[i];
        sort(a + 1, a + 1 + n, greater<int>());

        for (int i = 2; i <= n; i++) a[i] += a[i - 1];

        while (q--) {
            int x;
            cin >> x;
            int res = lower_bound(a + 1, a + 1 + n, x) - a;

            if (res > n) res = -1;
            cout << res << endl;
        }
    }
    return 0;
}